﻿<Window x:Class="P2.Cuberry.Modules.SimpleCRM.CRContact.CRContactsDetailsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
    xmlns:basec="clr-namespace:P2.Cuberry.Framework.Helper;assembly=P2.Cuberry.Framework.Helper" 
        
        Icon="/P2.Cuberry;component/Images/CuberryIcon32.ico"
        Title="Peacequare Cuberry" Width="920" Height="480"  
        Background="{DynamicResource P2BackgroundBrush}" 
        Closing="Window_Closing"
        >

    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/Styles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid>
        <Grid.Resources>
            <Image x:Key="SaveIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleCRM.CRContact;component/Images/save.png" />
            <Image x:Key="CancelIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleCRM.CRContact;component/Images/cancel.png" />
            <Image x:Key="ClosingIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleCRM.CRContact;component/Images/save.png" />

            <Image x:Key="Printer2Icon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleCRM.CRContact;component/Images/printer2.png" />


        </Grid.Resources>


        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="35" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="35" />
        </Grid.RowDefinitions>

        <!-- Row 0 Start -->
        <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Content="{Translate DialogHeaderCRContactDetail}" Style="{StaticResource P2DetailViewHeaderTextStyle}" />
        
        <Separator Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" VerticalAlignment="Bottom" Height="0"/>
        <!-- Row 0 End -->

        <!-- Row 1: Menu Start -->
        <Border  Grid.Row="1" Grid.Column="0"  Style="{StaticResource P2MenuBorderStyle}">
            <Grid>
            <Menu Grid.Row="1" x:Name="menuMain" Style="{StaticResource P2MenuStyle}" >
                <MenuItem x:Name="SaveBtn" Margin="2,1,0,2"  InputGestureText="Ctrl+S" Header="{Translate SaveBtn}" Command="{Binding CRContactSaveCommand}"  Icon="{StaticResource SaveIcon}" Style="{StaticResource P2MenuItemStyle}" />
                <MenuItem x:Name="CloseBtn" Margin="2,1,0,2" InputGestureText="Ctrl+X" Header="{Translate SaveAndCloseBtn}" Command="{Binding CRContactCloseCommand}" Icon="{StaticResource CancelIcon}" Style="{StaticResource P2MenuItemStyle}"/>
                                
                <MenuItem x:Name="PrintBtn" Margin="2,1,0,2" Header="{Translate PrintBtn}" Click="PrintBtn_Click" Icon="{StaticResource Printer2Icon}" Style="{StaticResource P2MenuItemStyle}"/>

            </Menu>
                <Menu Grid.Row="1" HorizontalAlignment="Right" x:Name="menuMainRight" Style="{StaticResource P2MenuStyle}" >
                    <MenuItem x:Name="HistoryBtn" Command="{Binding HistoryCommand}"  Style="{StaticResource P2MenuItemStyleHistory}"/>
                    <MenuItem x:Name="InfoBtn" Command="{Binding InfoCommand}"  Style="{StaticResource P2MenuItemStyleInfo}"/>
                </Menu>
            </Grid>
        </Border>


        <!-- Row 1 End -->

        <!-- Row 2: All Fields -->
        <Border  Grid.Row="2" Grid.Column="0"  Style="{StaticResource P2ContentBorderStyle}">
            <Grid Grid.Row="2" Grid.Column="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="604*"/>
                    <ColumnDefinition Width="0*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Label Margin="10,6,0,0" Name="ContactNoL" Height="28" VerticalAlignment="Top" Content="{Translate ContactNoL}" HorizontalAlignment="Left" Width="120"></Label>
                <TextBox Margin="10,27,0,0" Name="ContactNo" Height="23" Text="{Binding Model.ContactNo, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Style="{StaticResource P2TextBoxStyle}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="247.47" />
                
                <Label Margin="10,52,0,0" Name="FirstNameEnL" Height="28" VerticalAlignment="Top" Content="{Translate FirstNameEnL}" HorizontalAlignment="Left" Width="120"></Label>
                <TextBox Margin="10,73,0,0" Name="FirstNameEn" Height="23" Text="{Binding Model.FirstNameEn, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Style="{StaticResource P2TextBoxStyle}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="247.47" />
                
                <Label Content="{Translate MiddleNameEnL}" Height="28" HorizontalAlignment="Left" Margin="10,92,0,0" Name="MiddleNameEnL" VerticalAlignment="Top" Width="120" />
                <TextBox Height="23" HorizontalAlignment="Left" Margin="10,114,0,0" Name="MiddleNameEn" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.MiddleNameEn, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" VerticalAlignment="Top" Width="247.47" />
                
                <Label Content="{Translate LastNameEnL}" Height="28" HorizontalAlignment="Left" Margin="10,133,0,0" Name="LastNameEnL" VerticalAlignment="Top" Width="120" />
                <TextBox HorizontalAlignment="Left" Margin="10,154,0,0" Name="LastNameEn" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.LastNameEn, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Width="247.47" Height="23" VerticalAlignment="Top" />
                <Label Content="{Translate FirstNameArL}" HorizontalAlignment="Left" Margin="10,184,0,0" Name="FirstNameArL" Width="120" Height="28" VerticalAlignment="Top" />
                <TextBox Height="23" HorizontalAlignment="Left" Margin="10,205,0,0" Name="FirstNameAr" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.FirstNameAr, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" VerticalAlignment="Top" Width="247.47" />
                <Label Content="{Translate MiddleNameArL}" Height="28" HorizontalAlignment="Left" Margin="10,226,0,0" Name="MiddleNameArL" VerticalAlignment="Top" Width="120" />
                <TextBox Height="23" HorizontalAlignment="Left" Margin="10,248,0,0" Name="MiddleNameAr" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.MiddleNameAr, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" VerticalAlignment="Top" Width="247.47" />
                <Label Content="{Translate LastNameArL}" Height="28" HorizontalAlignment="Left" Margin="10,269,0,0" Name="LastNameArL" VerticalAlignment="Top" Width="120" />
                <TextBox Height="23" HorizontalAlignment="Left" Margin="10,290,0,0" Name="LastNameAr" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.LastNameAr, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" VerticalAlignment="Top" Width="247.47" />
                
                <TabControl Margin="341,3,3,0" Name="tabControl1" MinWidth="540" MinHeight="317" BorderBrush="{DynamicResource P2BackgroundBrush}"   VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                    <TabItem Header="{Translate AddressTab}" Name="AddressTab" Background="White" >
                        <Grid  Background="White">                            
                            
                            <Label Margin="10,10,0,0" Name="StreetL" Height="28" VerticalAlignment="Top" Content="{Translate StreetL}" HorizontalAlignment="Left" Width="120"></Label>
                            <TextBox Margin="10,31,173,0" Name="Street" Height="23" Text="{Binding Model.Street, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Style="{StaticResource P2TextBoxStyle}" VerticalAlignment="Top" />

                            <Label Margin="10,54,0,0" Content="{Translate ZIPCodeL}" HorizontalAlignment="Left"  Name="ZIPCodeL" Width="120" Height="27.723" VerticalAlignment="Top" />
                            <TextBox Margin="10,75,0,0" Name="ZIPCode" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.ZIPCode, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" HorizontalAlignment="Left" Width="120" Height="22.723" VerticalAlignment="Top" />
                            
                            <Label Margin="159,54,251,0" Content="{Translate CityL}" Name="CityL" Height="27.723" VerticalAlignment="Top" />
                            <TextBox Margin="159,75,173,0" Name="City" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.City, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Height="22.723" VerticalAlignment="Top" />

                            <Label Margin="159,93,264.53,0" Content="{Translate CountryIDL}"  Name="CountryIDL" Height="27.723" VerticalAlignment="Top" />
                            <ComboBox Margin="159,113,173,0" DisplayMemberPath="CountryNameCur" Name="CountryID" SelectedValuePath="CountryID" 
                                      SelectedValue="{Binding CountryID, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"   
                                      ItemsSource="{Binding Countries}"
                                      IsEnabled="{Binding IsEditable}"
                                      Style="{StaticResource P2ComboBoxStyle}" 
                                      Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Height="23.723" VerticalAlignment="Top" />

                            <ComboBox Margin="0,254,95,0" DisplayMemberPath="PersonTitleCur" Name="TitleID" SelectedValuePath="TitleID"
                                      SelectedValue="{Binding TitleID, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" 
                                      ItemsSource="{Binding PersonTitles}" 
                                      IsEnabled="{Binding IsEditable}"                                                                            
                                      Style="{StaticResource P2ComboBoxStyle}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" 
                                      HorizontalAlignment="Right" Width="133" Height="23.723" VerticalAlignment="Top" />

                            <Label Margin="10,96,0,0" Content="{Translate EMailL}" HorizontalAlignment="Left"  Name="EMailL" Width="120" Height="27.723" VerticalAlignment="Top" />
                            <TextBox Margin="10,117,0,0" Name="EMail" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.EMail, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" HorizontalAlignment="Left" Width="120" Height="22.723" VerticalAlignment="Top" />

                            <Label Margin="10,147,0,0" Content="{Translate PhoneMobileL}" HorizontalAlignment="Left"  Name="PhoneMobileL" Width="120" Height="27.723" VerticalAlignment="Top" />
                            <TextBox Margin="10,168,0,0" Name="PhoneMobile" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.PhoneMobile, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" HorizontalAlignment="Left" Width="120" Height="22.723" VerticalAlignment="Top" />

                            <Label Margin="159,147,251,0" Content="{Translate PhoneHomeL}" Name="PhoneHomeL" Height="27.723" VerticalAlignment="Top" />
                            <TextBox Margin="159,168,251,0" Name="PhoneHome" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.PhoneHome, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Height="22.723" VerticalAlignment="Top" />


                            <Label Margin="10,191,0,0" Name="DateOfBirthL" Content="{Translate DateOfBirthL}" HorizontalAlignment="Left" Width="120" Height="27.723" VerticalAlignment="Top"></Label>
                            <DatePicker Margin="13,211,0,0" Name="DateOfBirth" SelectedDate="{Binding Model.DateOfBirth, Mode=TwoWay}" xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit" HorizontalAlignment="Left" Width="107" Height="23.723" VerticalAlignment="Top" />


                            <Label Content="{Translate SalutationL}" Margin="159,191,251,0" Name="SalutationL" Height="27.723" VerticalAlignment="Top" />
                            <TextBox Margin="159,212,173,0" Name="Salutation" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.Salutation, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Height="22.723" VerticalAlignment="Top" />

                            <Label Content="{Translate GenderIDL}" HorizontalAlignment="Left" Margin="13,234,0,0" Name="GenderIDL" Width="109.47" Height="27.723" VerticalAlignment="Top" />
                            <ComboBox DisplayMemberPath="GenderCur" HorizontalAlignment="Left" IsEnabled="{Binding IsEditable}" ItemsSource="{Binding Genders}" Margin="13,254,0,0" Name="GenderID" SelectedValue="{Binding GenderID, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" SelectedValuePath="GenderID" Style="{StaticResource P2ComboBoxStyle}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Width="107" Height="23.723" VerticalAlignment="Top" />
                            
                            <Label Content="{Translate MaritalStatusIDL}" Margin="159,234,261.53,0" Name="MaritalStatusIDL" Height="27.723" VerticalAlignment="Top" />
                            <ComboBox DisplayMemberPath="MaritalStatusCur" IsEnabled="{Binding IsEditable}" ItemsSource="{Binding MaritalStatuss}" Margin="159,254,264,0" Name="MaritalStatusID" SelectedValue="{Binding MaritalStatusID, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" SelectedValuePath="MaritalStatusID" Style="{StaticResource P2ComboBoxStyle}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Height="23.723" VerticalAlignment="Top" />
                            
                            <Label Content="{Translate TitleIDL}" Margin="0,234,148,0" Name="TitleIDL" HorizontalAlignment="Right" Width="80" Height="27.723" VerticalAlignment="Top" />
                            
                            
                        </Grid>
                    </TabItem>
                    <TabItem Header="{Translate OfficeTab}" Name="OfficeTab" Background="White" >                    
                        <Grid  Background="White" >
                            <Label Margin="10,101,0,0" Content="{Translate PhoneOfficeL}" HorizontalAlignment="Left"  Name="PhoneOfficeL" Width="120" Height="27.723" VerticalAlignment="Top" />
                            <TextBox Margin="10,122,0,0" Name="PhoneOffice" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.PhoneOffice, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" HorizontalAlignment="Left" Width="120" Height="22.723" VerticalAlignment="Top" />

                            <Label Margin="0,10.001,115,0" Content="{Translate OrganisationIDL}"  Name="OrganisationIDL" Height="27.723" VerticalAlignment="Top" HorizontalAlignment="Right" Width="126" />
                            <ComboBox Margin="0,30.001,23,0" DisplayMemberPath="OrganisationNameCur" Name="OrganisationID" SelectedValuePath="OrganisationID" SelectedValue="{Binding OrganisationID, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"   
                                      ItemsSource="{Binding Organisations}"
                                      IsEnabled="{Binding IsEditable}"
                                      Style="{StaticResource P2ComboBoxStyle}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Height="23.722" VerticalAlignment="Top" HorizontalAlignment="Right" Width="218" />


                            <Label Margin="0,56,135,0" Content="{Translate RelationTypeIDL}"  Name="RelationTypeIDL" Height="27.723" VerticalAlignment="Top" HorizontalAlignment="Right" Width="106" />
                            <ComboBox Margin="0,76,23,0" DisplayMemberPath="RelationTypeCur" Name="RelationTypeID" SelectedValuePath="RelationTypeID" SelectedValue="{Binding RelationTypeID, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"   
                                      ItemsSource="{Binding RelationTypes}"
                                      IsEnabled="{Binding IsEditable}"
                                      Style="{StaticResource P2ComboBoxStyle}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Height="23.722" VerticalAlignment="Top" HorizontalAlignment="Right" Width="218" />

                            
                            
                            <Label Margin="8,10,0,0" Content="{Translate PositionL}" Name="PositionL" Height="27.723" VerticalAlignment="Top" HorizontalAlignment="Left" Width="126" />
                            <TextBox Margin="8,31,258,0" Name="Position" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.Position, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Height="22.723" VerticalAlignment="Top" />

                            <Label Margin="10,55,0,0" Content="{Translate JobTitleL}" HorizontalAlignment="Left"  Name="JobTitleL" Width="120" Height="27.723" VerticalAlignment="Top" />
                            <TextBox Margin="10,76,258,0" Name="JobTitle" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.JobTitle, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Height="22.723" VerticalAlignment="Top" />
                            <Label Content="{Translate NoteL}" HorizontalAlignment="Left" Margin="9,148,0,0" Name="NoteL" Width="120" Height="22.723" VerticalAlignment="Top" />
                            <TextBox IsReadOnly="{Binding IsReadOnly}" Margin="9,169,6,5" Name="Note" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.Note, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" VerticalScrollBarVisibility="Auto" />
                        </Grid  >                        
                    </TabItem>
                </TabControl>
            </Grid>
        </Border>

        <!-- Row 2: End -->


        <!-- Row 3: Bottom: Status Bar Start -->
        <Border Grid.Row="3" Grid.Column="0" Style="{StaticResource P2StatusStripBorderStyle}" >
            <Grid Grid.Row="3" Grid.Column="0" Style="{StaticResource P2StatusStripGridStyle}">
                <basec:P2StatusStrip x:Name="StatusStrip" MessageStack2="{Binding MessageStack}"  Grid.Column="0" Grid.Row="3" Height="Auto" Width="Auto" Background="White" HorizontalAlignment="Left" ContentStringFormat=""></basec:P2StatusStrip>
                <TextBox Name="Status" Grid.Column="0" Grid.Row="3" Height="Auto" Width="Auto" Background="White" HorizontalAlignment="Right" Text="{Binding Model.StatusName, Mode=OneWay}" IsReadOnly="True" BorderBrush="Transparent" />
            </Grid>
        </Border>

        <!-- Row 3: End -->
    </Grid>
</Window>
